<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

//define field to generate form
if (!function_exists('loginFieldForm')) {

    function loginFieldForm()
    {
        $_field_form_login = array(
            'username' => array('name' => 'username', 'id' => 'frm-login-email',
                'class' => 'span3', 'placeholder' => 'Username',
                'value' => set_value('username')),
            'password' => array('name' => 'password', 'id' => 'frm-login-password',
                'class' => 'span3', 'placeholder' => 'Password', 'autocomplete' => 'off'),
            'submit' => array('class' => 'btn btn-primary', 'data-loading-text' => 'Loading...',
                'id' => 'form-login-btnLogin', 'value' => 'Login')
        );

        return $_field_form_login;
    }

}

//define field to validate form
if (!function_exists('loginFieldValidate')) {

    function loginFieldValidate()
    {
        $_field_validate_login = array(
            array(
                'field' => 'username',
                'label' => 'Username',
                'rules' => 'trim|required|min_length[5]|max_length[12]|xss_clean'
            ),
            array(
                'field' => 'password',
                'label' => 'Password',
                'rules' => 'required',
            ),
        );
        return $_field_validate_login;
    }

}